package nju.edu.super_scholar.PersonalInfoManage;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import nju.edu.super_scholar.vo.FriendsInfoVO;
import nju.edu.super_scholar.vo.FriendsVo;
import nju.edu.super_scholar.xmlHelper.XmlImpl;
import nju.edu.super_scholar.xmlHelper.XmlMethod;

import org.w3c.dom.Element;

import dataservice.FriendInfoOp;

public class DeleteFriend extends HttpServlet{
	static final private String CONTENT_TYPE = "text/xml; "
			+ "charset=utf-8";  
	PrintWriter out;
	
	public void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException{
		resp.setContentType(CONTENT_TYPE);
		out = resp.getWriter();
		
		String myID = req.getParameter("myID");
		String friendID = req.getParameter("friendID");
		
		FriendInfoOp friendInfoOp = new FriendInfoOp();
		FriendsVo friendsVo = new FriendsVo(myID, friendID, true, true);
		friendInfoOp.deleteFriend(friendsVo);
	}
	
	public void doGet(HttpServletRequest req, HttpServletResponse resp)throws IOException{
		doPost(req, resp);
	}
	
}
